let PubSub = require('pubsub-js');

//订阅            频道
PubSub.subscribe('周杰伦', (channel, data) => {
    console.log('周杰伦发布了新的消息, 消息为: ' + data);
});

PubSub.subscribe('周杰伦', (channel, data) => {
    console.log('我收到了杰伦的消息: ' + data);
})

//发布         频道
PubSub.publish('周杰伦', '我发布新专辑名称为: mojito');